﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RealtyManagementSystem.DAL;

namespace RealtyManagementSystem.Web.RealtyManagers
{
    public partial class AddShopLot : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            using (var context = new realtydbEntities())
            {
                var spa = Convert.ToSingle(this.txtArea.Text);

                var sl = new ShopLot()
                  {
                      Shopkeeper = this.txtOwner.Text,
                      ShopkeeperIdCardNo = this.txtIdNo.Text,
                      Space = spa
                  };

                context.AddToShopLots(sl);
                context.SaveChanges();
            }
        }
    }
}